/* 
   ============================================================
   superclass-core.css - Componentes Globales del Design System
   Acá centralizamos las clases que NO son solo tokens de Tailwind,
   sino estructuras de UI reutilizables.
   ============================================================ */

/* --- RESET & GLOBALES --- */
* {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* --- COMPONENTES DE UI --- */

/* Títulos de sección con el acento de marca */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-zinc-dark);
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* El contenedor estándar para todas las tarjetas de la app */
.card-container {
    background: white;
    border-radius: 0.75rem;
    /* rounded-xl (12px) per premium look */
    border: 1px solid #E5E7EB;
    padding: 1.25rem;
    /* card-p reduced */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* shadow-sm */
}

/* Acordeón Premium (Global) */
.details-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.details-card summary {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--color-zinc-dark);
}

.details-card summary::-webkit-details-marker {
    display: none;
}

.details-card summary::after {
    content: '+';
    font-size: 1.25rem;
    color: #9CA3AF;
    font-weight: 400;
    transition: transform 0.2s;
}

.details-card[open] summary::after {
    transform: rotate(45deg);
}

.details-card[open] summary {
    border-bottom: 1px solid #F3F4F6;
}

.details-card>div {
    padding: 1.25rem;
    padding-top: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

/* Tarjeta destacada (Ej: Actividad Virtual) */
.card-highlight {
    background: linear-gradient(to bottom right, #F3FAF7, #FFFFFF);
    /* from-mint-cream to-white */
    border-color: rgba(49, 196, 141, 0.2);
    /* border-mint-leaf/20 */
}

/* Header estándar dentro de tarjetas */
.card-header {
    font-weight: 700;
    color: var(--color-zinc-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    /* text-base */
}

/* Barra de acciones (Ej: Resource Action Bar) */
.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Tarjetas que reaccionan al pasar el mouse */
.interactive-card {
    transition: all 0.2s ease;
}

.interactive-card:hover {
    transform: translateY(-2px);
    border-color: #31C48D;
    /* mint-leaf */
    box-shadow: 0 10px 20px -5px rgba(49, 196, 141, 0.15);
    /* shadow-hover-mint */
}

/* Base de tarjetas del nuevo Bento Grid de Escritorio */
.bento-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-interactive {
    transition: all 0.2s ease;
    cursor: pointer;
}

.bento-interactive:hover {
    transform: scale(0.98);
}

.bento-interactive:active {
    transform: scale(0.95);
}

/* --- ICONOS --- */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

/* --- SOMBRAS (Elite Shadows) --- */
.shadow-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.shadow-hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

/* --- UTILIDADES EXTRA --- */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}

/* --- COMPONENTS: CHIPS --- */
.diag-chip {
    display: block;
    padding: 0.75rem 1rem;
    background-color: white;
    border: 1px solid #E5E7EB;
    /* zinc-200 */
    border-radius: 0.75rem;
    color: var(--color-zinc-dark);
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.875rem;
    cursor: pointer;
}

.diag-chip:hover {
    border-color: #84E1BC;
    /* mint-light */
    background-color: #F3FAF7;
    /* mint-cream */
}

.peer:checked+.diag-chip {
    border-color: #31C48D;
    /* mint-leaf */
    background-color: #DEF7EC;
    /* honeydew */
    color: var(--color-zinc-dark);
    box-shadow: 0 0 0 2px rgba(49, 196, 141, 0.2);
    /* mint shadow */
    font-weight: 700;
}

/* --- UTILITIES: SCROLLBAR --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #F3FAF7;
    /* mint-cream */
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #84E1BC;
    /* mint-light */
    border-radius: 10px;
    border: 2px solid #F3FAF7;
    /* mint-cream */
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #31C48D;
    /* mint-leaf */
}

/* --- ANIMATIONS --- */
@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Animación de pulso para llamadas a la acción (CTA) */
@keyframes pulse-action {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(49, 196, 141, 0);
        /* mint-leaf transparent */
    }

    50% {
        box-shadow: 0 0 14px 5px rgba(49, 196, 141, 0.35);
        /* mint-leaf con opacidad */
    }
}


/* --- COMPONENTES GLOBALES: BOTONES --- */
/* Definidos en el Design System v3.0 */

/* Base compartida para todos los botones */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    /* rounded-lg */
    padding: 0.625rem 1.5rem;
    /* py-2.5 px-6 */
    font-weight: 700;
    font-size: 0.875rem;
    /* text-sm */
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

/* PRIMARIO: Acción principal (Mint Leaf - Identidad SuperClass) */
.btn-primary {
    background-color: #31C48D;
    /* mint-leaf */
    color: white;
    border-color: #31C48D;
    box-shadow: 0 4px 6px -1px rgba(49, 196, 141, 0.2);
    /* shadow-mint-leaf */
}

.btn-primary:hover {
    background-color: #1FA676;
    /* mint-hover */
    border-color: #1FA676;
    box-shadow: 0 10px 15px -3px rgba(49, 196, 141, 0.3);
    transform: translateY(-2px);
}

/* SECUNDARIO: Acciones alternativas (White + Border) */
.btn-secondary {
    background-color: white;
    color: var(--color-zinc-dark);
    border-color: #E5E7EB;
    /* zinc-200 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #F9FAFB;
    /* gray-50 */
    border-color: #D1D5DB;
    /* gray-300 */
}

/* DESTACADO / ACCENT: Acciones positivas secundarias (Honeydew) */
.btn-accent {
    background-color: #DEF7EC;
    /* honeydew */
    color: #31C48D;
    /* mint-leaf (Texto color marca) */
    border-color: transparent;
}

.btn-accent:hover {
    border-color: #31C48D;
    /* Borde mint-leaf en hover */
    background-color: #DEF7EC;
    /* Mismo fondo */
    color: #1FA676;
    /* mint-hover (Texto un poco más oscuro) */
}

.btn-full {
    width: 100%;
}

/* ESTRUCTURALES: Navegación y Admin (Zinc Family) */
.btn-structural-solid {
    background-color: var(--color-zinc-dark);
    /* Color estructural desde la paleta central */
    color: white;
    border-color: var(--color-zinc-dark);
}

.btn-structural-solid:hover {
    background-color: var(--color-slate-800);
    border-color: var(--color-slate-800);
    transform: translateY(-2px);
}

.btn-structural-outline {
    background-color: transparent;
    color: var(--color-zinc-dark);
    border-color: var(--color-zinc-dark);
}

.btn-structural-outline:hover {
    background-color: var(--color-slate-50);
}

.btn-structural-ghost {
    background-color: transparent;
    color: var(--color-slate-500);
    border-color: transparent;
    box-shadow: none;
}

.btn-structural-ghost:hover {
    background-color: var(--color-slate-50);
    color: var(--color-zinc-dark);
}

/* --- ANIMACIONES --- */

/* Borde Animado Premium (AI & Edit) */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotate-border {
    to {
        --angle: 360deg;
    }
}

.animated-border-brand {
    position: relative;
    background: white;
    z-index: 0;
    overflow: hidden;
    border: none !important;
    /* MATA cualquier borde existente para que el pseudo mande */
}

/* Pseudo-elemento rotando detrás */
.animated-border-brand::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -2px;
    /* Grosor del borde */
    background: conic-gradient(from 0deg,
            transparent 0%,
            #1FA676 25%,
            /* Mint Hover (Verde Oscuro) */
            transparent 50%);
    animation: rotate-border-spin 3s linear infinite;
    border-radius: 0.6rem;
    /* Un poco menos que el padre para encajar visualmente o igual */
}

/* Fondo blanco interno para simular que solo es borde */
.animated-border-brand::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 2px;
    /* Grosor visual del borde */
    background: white;
    border-radius: 0.5rem;
    /* rounded-lg aprox */
}

@keyframes rotate-border-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Ajuste hover */
.animated-border-brand:hover::before {
    animation-duration: 1.5s;
    background: conic-gradient(from 0deg,
            transparent 0%,
            #31C48D 25%,
            /* Mint Leaf (más brillante al hover) */
            transparent 50%);
}

/* --- UTILITIES: SCROLLBAR HIDE --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* --- ANIMACION: OCR Scanner --- */
/* Barra que se mueve de arriba a abajo simulando un escáner */
@keyframes ocr-scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.animate-ocr-scan {
    animation: ocr-scan 2s linear infinite;
}

/* --- ESCALADO ADAPTATIVO PARA PANTALLAS DENSAS ---
   Problema: celulares como el Moto Edge 50 tienen alta densidad de píxeles
   (más de 2.5x), lo que hace que todo se vea pequeño aunque el viewport
   esté bien configurado.
   Solución: subimos el font-size base de 16px a 18px en esos casos.
   Como Tailwind usa "rem" internamente, todo el diseño (botones, textos,
   paddings) se agranda proportionalmente sin cambiar nada más.
   
   Las condiciones aplican cuando:
   - La pantalla es chica en píxeles CSS (< 400px): cubre la mayoría de celulares
   - Y/O la densidad es alta (> 2.5x): cubre específicamente los de alta resolución
*/
@media screen and (max-width: 400px) {
    html {
        font-size: 16.5px;
    }
}

@media screen and (min-resolution: 2.5dppx) and (max-width: 430px) {
    html {
        font-size: 16.5px;
    }
}